<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html;" charset="<?php echo CHARSET;?>">
<title>本地生活</title>
<link href="/xiuliqiankun/Public/admin/css/skin_0.css" rel="stylesheet" type="text/css" id="cssfile"/>
<script type="text/javascript" src="/xiuliqiankun/Public/static/jquery.js"></script>
<script type="text/javascript" src="/xiuliqiankun/Public/static/jquery.validation.min.js"></script>
<script type="text/javascript" src="/xiuliqiankun/Public/admin/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/xiuliqiankun/Public/admin/js/admincp.js"></script>
<script type="text/javascript" src="/xiuliqiankun/Public/admin/js/jquery.tooltip.js"></script>
<script language="javascript">
var SiteUrl = '<?php echo (C("SiteUrl")); ?>';
var AdminUrl = SiteUrl+'/<?php echo (MODULE_NAME); ?>';
</script>
</head><body>
<style>
    .unchecked{
        border: 1px solid gray;
        padding: 6px 6px 6px 6px;
    }
    .checked{
        border: 2px solid gray;
        padding: 6px 6px 6px 6px;
        color: rgb(85, 85, 85);
    }
</style>
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <h3>广告管理</h3>
      <ul class="tab-base">
        <li><a href="<?php echo U('ClubManager/position');?>"><span>管理</span></a></li>
        <li><a href="JavaScript:void(0);" class="current"><span>查看</span></a></li>
      </ul>
    </div>
  </div>
  <div class="fixed-empty"></div>
  <form id="link_form" enctype="multipart/form-data" method="post">
    <table class="table tb-type2">
      <tbody>
        <tr class="noborder">
          <td colspan="2" class="required"><label for="ap_name">名称:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform"><?php echo ($vo['name']); ?>
            </td>
          <td class="vatop tips"></td>
        </tr>        
      </tbody>
      
      <tbody>
        <tr>
          <td colspan="2" class="required"><label for="change_default_pic">证件照</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
            
            <a target="_blank" href=<?php echo ($vo['identification_photo']); ?>><img style="width: 400px;" src=<?php echo ($vo['identification_photo']); ?>>
          </td>
        </tr>       
      </tbody>

      <tbody>
        <tr>
          <td colspan="2" class="required"><label for="change_default_pic">学生证照</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
          <a target="_blank" href=<?php echo ($vo['student_photo']); ?>><img style="width: 400px;" src=<?php echo ($vo['student_photo']); ?>></a>
          </td>
        </tr>       
      </tbody>

      <tbody>
        <tr>
          <td colspan="2" class="required"><label for="change_default_pic">logo图片</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
          <a target="_blank" href=<?php echo ($vo['logo']); ?>><img style="width: 400px;" src=<?php echo ($vo['logo']); ?>></a>
          </td>
        </tr>       
      </tbody>

      <tbody id="default_word">
        <tr>
          <td colspan="2" class="required"><label>简介:</label></td>
        </tr>
        <tr class="noborder">
          <td class="vatop rowform">
          <?php echo ($vo['desc']); ?>
          </td>
          <td class="vatop tips"></td>
        </tr>
      </tbody>  

      <tbody id="default_word">
        <tr>
          <td colspan="2" class="required"><label>是否通过审核:</label></td>
        </tr>
        <tr class="noborder">
          <td class="rowform">
            <div>
                <input name="status" value="1" type="hidden" />
                <span c_value='1' class='checked'  name='sizeSpan'  checked='false' onclick='change(this);' >通过</span> 

                <span c_value='-1' class='unchecked' name='sizeSpan' checked='false' onclick='change(this);' >拒绝</span> 
            </div>
          </td>
          <td class="vatop tips">默认通过审核</td>
        </tr>
      </tbody>   
      
      <tfoot>
        <tr class="tfoot">
        <input type='hidden' name='id' value="<?php echo ($vo['id']); ?>">
          <td colspan="15" ><a href="JavaScript:void(0);" class="btn" id="submitBtn"><span>保存</span></a></td>
        </tr>
      </tfoot>
    </table>
  </form>
</div>

<script>
//按钮先执行验证再提交表单
$(function(){$("#submitBtn").click(function(){
    if($("#link_form").valid()){
     $("#link_form").submit();
	}
	});
});
//
$(document).ready(function(){
	
	$('#link_form').validate({
        errorPlacement: function(error, element){
			error.appendTo(element.parent().parent().prev().find('td:first'));
        },
        success: function(label){
            label.addClass('valid');
        },
        rules : {
        	ap_name : {
                required : true
            },
			ap_code : {
				 required : true	
			},
            ap_link:{
				url : true
           	}	
/*			ap_width:{
				required :function(){return $("#ap_class").val()!=1;},
				digits	 :true,
				min:1
			},
			ap_height:{
				required :function(){return $("#ap_class").val()!=1;},
				digits	 :true,
				min:1
			},
			default_content  :{
				required :function(){return $("#ap_class").val()==1;}
			}*/
        },
        messages : {
        	ap_name : {
                required : '请输入标题'
            },
			ap_code : {
				 required : '请输入调用代码'	
			},			
            ap_link : {
				url : '链接地址格式错误'
            }		
/*            ap_width	:{
            	required : '请输入宽度',
            	digits	:'格式错误',
            	min	:'1px以上'
            },
            ap_height	:{
            	required   : '请输入高度',
            	digits	:'格式错误',
            	min	:'1px以上'
            },            
            default_content	:{
            	required   : '请输入文字信息'
            }*/
        }
    });
});
</script>
<script type="text/javascript">
// 模拟网站LOGO上传input type='file'样式
$(function(){
	$("#default_pic").change(function(){
		$("#txt_default_pic").val($(this).val());
	});
// 上传图片类型
$('input[class="type-file-file"]').change(function(){
	var filepatd=$(this).val();	
	var extStart=filepatd.lastIndexOf(".");
	var ext=filepatd.substring(extStart,filepatd.lengtd).toUpperCase();		
		if(ext!=".PNG"&&ext!=".GIF"&&ext!=".JPG"&&ext!=".JPEG"){
			alert("图片格式错误");
				$(this).attr('value','');
			return false;
		}
	});
});
</script>

<script language="javascript">
    var obj={
        colorSpan:"",
        sizeSpan:""
    };
    function change(span)
    {
        $('span[name="'+$(span).attr('name')+'"]').each(function(){
            //    if(this.checked&&this!=span)
            // {
            this.className="unchecked";
            this.checked=false;
            // }
        });
        obj[$(span).attr('name')]=span.innerHTML;
        span.className="checked";
        span.checked=true;
        var c_value=$(span).attr('c_value');
        $('input[name="status"]').val(c_value);
    }
    function select(c_value)
    {
        var html='';
        for(var i in obj)
        {
            if(obj[i]!='')
            {
                html+='<font color=orange>"'+ obj[i]+'"</font> 、';
            }
        }
        // html='<b>已选择:</b> '+html.slice(0,html.length-1);
        // $('#resultSpan').html(html);

    }
</script>
</body></html>